<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Adicionar Detalle de Materia</title>
<link rel="stylesheet" href="<c:url value='/css/estilos.css'/>" />
<script type="text/javascript">
	function validations() {

		if ("" == document.forms.subjectDetailForm.subjectDetailCode.value
				|| "" == document.forms.subjectDetailForm.subjectDate.value
				|| "" == document.forms.subjectDetailForm.subjectTime.value) {
			alert("Complete los campos requeridos");
			return false;
		}

		return true;
	}
</script>

</head>
<body>
<header> <jsp:include page="items.jsp"></jsp:include> </header>
	<h1>Crear Nuevo Detalle de Materia</h1>

	<c:url var="saveUrl" value="/subjectdetail/add" />
	<form:form name="subjectDetailForm" modelAttribute="subjectDetailAttribute"
		method="POST" action="${saveUrl}" onsubmit="return validations();">
		<table>
			<tr>
				<td><form:label path="subjectDetailCode">C&oacutedigo:</form:label></td>
				<td><form:input path="subjectDetailCode" id="subjectDetailCode" /></td>
			</tr>
			<tr>
				<td><form:label path="subjectCode">C&oacutedigo de Materia:</form:label></td>
				<td><form:input path="subjectCode" id="subjectCode"/></td>
			</tr>
			<tr>
				<td><form:label path="subjectDateString">D&iacutea:</form:label></td>
				<td><form:input path="subjectDateString" id="subjectDateString" /></td>
			</tr>
			<tr>
				<td><form:label path="subjectTime">Hora:</form:label></td>
				<td><form:input path="subjectTime" id="subjectTime" /></td>
			</tr>
			<tr>
				<td><form:label path="placeCode">Lugar:</form:label></td>
				<td><form:select path="placeCode" id="placeCode">
						<form:options items="${placeCodeList}" itemLabel="placeName"
							itemValue="placeCode" />
					</form:select></td>
			</tr>
		</table>

		<input type="submit" value="Guardar" />
	</form:form>

</body>
</html>